﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>天数调整</title>
    <link href="~/plugins/layui/css/layui.css" rel="stylesheet" />
</head>
<body style="margin-left:10px;margin-top:10px;">
    <div id="ss" class="layui-form-item">
        <div class="layui-inline">
            <div class="layui-input-inline" style="width: 30px;">
                <i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe615;</i>
            </div>
            <div class="layui-input-inline" style="width: 50px;">
                <input type="text" placeholder="天数" id="tian" name="tian" class="layui-input" onkeyup="value=value.replace(/[^\d]/g,'');" />
            </div>
            <div class="layui-input-inline">
                <button onclick="AT();" class="layui-btn">激活用户全部增加天数</button>
            </div>
        </div>
    </div>
    <div class="layui-form">
        <table class="layui-table">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>卡密</th>
                    <th>套餐名称</th>
                    <th>激活数据</th>
                    <th>激活时间</th>
                    <th>调整天数</th>
                </tr>
            </thead>
            <tbody id="tbody">
                <script id="tpl" type="text/html">
                    {{each list as item index}}
                <tr style="background-color:{{index%2 ==0 ?"#FFFFF0":""}};" id="{{item.gid}}">
                    <td>{{index+1}}</td>
                    <td style="color:blue;">{{item.coupon_number}}</td>
                    <td>{{item.name}}<div class="layui-btn layui-btn-mini layui-btn-warm layui-border-gree">{{item.tianshu}}天</div></td>
                    <td style="color:red;">{{item.remarks}}</td>
                    <td>{{item.pay_time}}</td>
                    <td>{{item.tgf}}</td>
                </tr>
                    {{/each}}
                </script>
            </tbody>
        </table>
    </div>
    <div id="page"></div>
    共 <label id="pages">0</label> 页, <label id="count">0</label> 条数据
    <label id="Controllers" class="layui-hide">at</label>
    <script src="~/js/jquery.js"></script>
    <script src="~/plugins/layui/layui.js"></script>
    <script src="~/js/template-web.js"></script>
    <script src="~/js/list.js"></script>
    <script src="~/js/daochu.js"></script>
    <script>
        //删除数据
        function AT() {
            if ($("#tian").val() > 0) {
                layer.confirm('你确定要执行此操作吗？', {
                    btn: ['确定', '取消'] //按钮
                }, function () {
                    $.ajax({
                        url: "/ljsheng/AT",
                        data: "tian=" + $("#tian").val(),
                        type: "post",
                        cache: false,
                        timeout: 8000,
                        dataType: "json",
                        ContentType: "application/json; charset=utf-8",
                        error: function () { layer.msg("请求超时"); },
                        beforeSend: function () { },
                        success: function (data) {
                            if (data.result == 200) {
                                layer.msg(data.data, { icon: 1 });
                                location.reload();
                            }
                            else {
                                layer.msg(data.data);
                            }
                        },
                    });
                });
            }
            else {
                layer.msg("天数必须是整数");
            }
        }
    </script>
</body>
</html>